package pl.streamsoft.test.currency_view.helpers;

import java.util.Calendar;
import java.util.Date;

import net.sourceforge.jdatepicker.DateModel;
import net.sourceforge.jdatepicker.impl.JDatePickerImpl;

public class DateHelper {
	
	public static Date getDate(JDatePickerImpl picker) {
		DateModel<?> model = picker.getModel();
		int day = model.getDay();
		int month = model.getMonth();
		int year = model.getYear();

		Calendar calendar = Calendar.getInstance();

		calendar.set(year, month, day);
		return calendar.getTime();
	}
	
}
